<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>HDCMS永久免费 - by HDCMS</title>
    {{jquery}}
    <link rel="stylesheet" href="{{__PUBLIC__}}/hdjs/hdjs.css"/>
    <script type="text/javascript" src="{{__PUBLIC__}}/hdjs/hdjs.min.js"></script>
    {{bootstrap}}
    {{css file="__VIEW__/common.css"}}
</head>
<body>
	<script type="text/javascript">
			function edit()
			{
				$.post("{{U('edit')}}",$("#form").serialize(),function(data){

						hd_alert({
							message: data.message,
							timeout: 3,
						});
					location.href="{{U('index')}}";
				},'json');
				return false;
			}
		</script>
    <form id="form" onsubmit="return edit()">
    	<input type="hidden" name="id" value="{{$field['id']}}">
			<table class="hd-table hd-table-form hd-form">
				<thead>
					<tr>
						<td colspan="3">
							设置菜单
						</td>
					</tr>
				</thead>
				<tbody>
					<tr>
                    <th width="100">父级</th>
                    <td>
                        <select name="pid">
                            <option value="0">顶级菜单</option>
                            {{foreach from="$data" key="$k" value="$v"}}
                            <option value="{{$v['id']}}" {{$v['_disabled']}} {{$v['_selected']}}>{{$v['_name']}}</option>
                            {{endforeach}}
                        </select>
                    </td>
                </tr>
                <tr>
						<th>
							name
						</th>
						<td>
							<input type="text" name="name" value="{{$field['name']}}" class="hd-w300">
						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								菜单标题，不超过16个字节，子菜单不超过40个字节
							</span>
						</td>
					</tr>
					
					<tr>
						<th>
							type
						</th>
						<td>
                        <input type="radio" name="type" value="1"
                            {{if value="$field['type']=='click'"}}
                                checked{{endif}}>click
                        <input type="radio" name="type" value="view"
                        {{if value="$field['type']=='view'"}}
                            checked{{endif}}
                            > view
                    </td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								菜单的响应动作类型
							</span>
						</td>
					</tr>
					<tr>
						<th>
							keyword
						</th>
						<td>
							<input type="text" name="key" value="{{$field['key']}}" class="hd-w300">
						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								菜单KEY值，用于消息接口推送，不超过128字节
							</span>
						</td>
					</tr>
					
					<tr>
						<th>
							URL
						</th>
						<td>
							<input type="text" name="url" value="{{$field['url']}}" class="hd-w300">
						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								网页链接，用户点击菜单可打开链接，不超过256字节
							</span>
						</td>
					</tr>
					<!--<tr>
						<th>
							button
						</th>
						<td>
							<input type="text" name="button" required="" value="{{$field['button']}}" class="hd-w300">
						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								菜单名称
							</span>
						</td>
					</tr>-->
					<!--<tr>
						<th>
							media_id
						</th>
						<td>
							<input type="text" name="media_id"  value="{{$field['media_id']}}" class="hd-w300">
						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								调用新增永久素材接口返回的合法media_id
							</span>
						</td>
					</tr>-->
					
					<tr>
						<th>
							描述
						</th>
						<td>
							<textarea name="describe" class="hd-w500 hd-h100">{{$field['describe']}}</textarea>																																			

						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								
							</span>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<input type="submit" class="hd-btn hd-btn-primary">
						</td>
						<td>
							<span class="hd-validate-notice" style="display: inline-block;">
								
							</span>
						</td>
					</tr>
				</tbody>
			</table>
		</form>
</body>
</html>